package com.loan.controller;

import com.loan.entity.Apply;
import com.loan.service.ApplyService;
import com.loan.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author z
 */
@RestController
@RequestMapping("/apply")
@Api(tags = "申请贷款管理")
@Slf4j
public class ApplyController {

    @Resource
    private ApplyService applyService;

    @ApiOperation(value = "新建申请",httpMethod = "POST")
    @PostMapping
    public ResponseResult<Object> addProApply(@RequestBody Apply apply){
        return applyService.addProAndApply(apply);
    }
    @ApiOperation(value = "通知",httpMethod = "GET")
    @GetMapping
    public ResponseResult<List> showProApply(){
        List list = applyService.showProApply();
        return ResponseResult.success(list);
    }
}
